package java_thinking.unit_18_IO._18_13;

import java.util.Scanner;
import java.util.prefs.Preferences;

import static java_thinking.net.mindview.util.Print.print;

/**
 * @Desc:   编写一个程序，显示的被称为“基目录”的目录中的当前值，并将其改变为你的值
 * @author: cww
 * @DateTime: 2019-05-19 16:08
 */

public class E33_PreferencesDemo {
    public static void main(String[] args) {
        Preferences pre = Preferences.userNodeForPackage(E33_PreferencesDemo.class);
        String directory = pre.get("base directory", "Not deFined");
        print("directory: " + directory);
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter a new Directory: ");
        directory = scanner.nextLine();
        pre.put("base directory", directory);
        print("\ndirectory: " + directory);
    }
}
